{!! admin_css('vendor/dcat-admin/dcat/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css?v2.2.2-beta') !!}
{!! admin_css('vendor/dcat-admin/dcat/plugins/select/select2.min.css?v2.2.2-beta') !!}
{!! admin_css('vendor/dcat-admin/dcat/extra/upload.css?v2.2.2-beta') !!}

<div class="content-body fitness-form" id="app">
    <div class="row">
        <div class="col-md-12">
            <form method="post" enctype="multipart/form-data" accept-charset="UTF-8" action="{{ url('admin/add_user_health') }}" class="" id="form-fitness">
                <!-- hidden value -->
                {{ csrf_field() }}
                <input type="hidden" value="{{ $userId }}" name="user_id" />
                @if(!empty($form)) <input name="form_id" hidden value="{{ $form->id }}"> @endif

                <div class="card">
                    <!-- 头部 -->
                    <div class="box-header with-border mb-1" style="padding: .65rem 1rem">
                        <h3 class="box-title" style="line-height:30px;">体态评估表</h3>
                        <div class="pull-right">
                            <div class="btn-group pull-right" style="margin-right: 5px">
                                <a href="#" class="btn btn-sm btn-primary "><i class="feather icon-list"></i><span
                                        class="d-none d-sm-inline">&nbsp;列表</span></a>
                            </div>
                        </div>
                    </div>

                    <!-- body -->
                    <div class="box-body" style="margin-top: 6px">
                        <div class="fields-group">
                            <div class="row">
                                <!-- 表单逻辑代码 -->
                                <div class="col-md-6">
                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>姓名</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-edit-2"></i></span></span>
                                                <input type="text" name="name" value="{{ $user?->name }}"
                                                       required disabled
                                                       class="form-control field_name _normal_" placeholder="输入 姓名">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group row form-field">


                                        <div class="col-md-2 text-capitalize control-label"><span>性别</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-user"></i></span></span>
                                                <select name="gender" class="form-control" disabled>
                                                    <option value="0" {{ $user && $user->gender == 0 ? 'selected' : '' }}>女</option>
                                                    <option value="1" {{ $user && $user->gender == 1 ? 'selected' : '' }}>男</option>
                                                </select>
                                            </div>
                                        </div>

                                    </div>

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>联系电话</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-phone"></i></span></span>
                                                <input type="text" disabled name="phone" value="{{ $user?->phone }}"
                                                       class="form-control field_name _normal_" placeholder="输入 联系电话">
                                            </div>
                                        </div>

                                    </div>

{{--                                    <div class="form-group row form-field">--}}
{{--                                        <div class="col-md-2 text-capitalize control-label"><span>生日</span></div>--}}
{{--                                        <div class="col-md-8 ">--}}
{{--                                            <div class="help-block with-errors"></div>--}}
{{--                                            <div class="input-group">--}}
{{--                                                <span class="input-group-prepend"><span--}}
{{--                                                        class="input-group-text bg-white"><i--}}
{{--                                                            class="fa fa-calendar fa-fw"></i></span></span>--}}
{{--                                                <input disabled style="width: 200px;flex:none" type="text" name="birthday"--}}
{{--                                                       value="{{ $user?->birthday }}" class="form-control field_birthday _normal_"--}}
{{--                                                       placeholder="输入 birthday">--}}
{{--                                            </div>--}}
{{--                                        </div>--}}
{{--                                    </div>--}}

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>年龄</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                                <span class="input-group-prepend"><span
                                                        class="input-group-text bg-white"><i
                                                            class="fa fa-calendar fa-fw"></i></span></span>
                                                <input style="width: 200px;flex:none" type="text" name="age"
                                                       value="{{ $age }}" class="form-control "
                                                       disabled
                                                       placeholder="年龄">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>体重</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-edit-2"></i></span></span>
                                                <input type="text" name="arm_cir_right" value="{{ $user->fitnessForm?->weight }}"
                                                       disabled
                                                       class="form-control field_name _normal_" placeholder="输入 右臂围">
                                            </div>
                                        </div>
                                    </div>

                                </div>
                                <!-- 左列结束 end -->

                                <!-- 右列 start -->
                                <div class="col-md-6">
                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>血压</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-edit-2"></i></span></span>
                                                <input type="text" name="blood_pressure" value="{{ $form?->blood_pressure }}"
                                                       class="form-control field_name _normal_"
                                                       placeholder="输入 血压">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>血糖</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-edit-2"></i></span></span>
                                                <input type="text" name="blood_sugar" value="{{ $form?->blood_sugar }}"
                                                       class="form-control field_name _normal_"
                                                       placeholder="输入 血糖">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>尿酸</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-edit-2"></i></span></span>
                                                <input type="text" name="uric_acid" value="{{ $form?->uric_acid }}"
                                                       class="form-control field_name _normal_" placeholder="输入 尿酸">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>BMI</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-edit-2"></i></span></span>
                                                <input type="text" name="bmi" value="{{ $form?->bmi }}"
                                                       class="form-control field_name _normal_" placeholder="输入 BMI">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>体脂率</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                            <span class="input-group-prepend"><span class="input-group-text bg-white"><i
                                                        class="feather icon-edit-2"></i></span></span>
                                                <input type="text" name="fat" value="{{ $form?->fat }}"
                                                       class="form-control field_name _normal_" placeholder="输入 体脂率">
                                            </div>
                                        </div>
                                    </div>

                                </div>
                                <!-- 右列 end -->


                            </div>

                            <hr/>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>病史</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                                <textarea type="text" name="med_history" rows="5"
                                                          class="form-control field_name _normal_"
                                                          placeholder="输入 病史">{{ $form?->med_history }}</textarea>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>曾用药</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                                <textarea type="text" name="past_med" rows="5"
                                                          class="form-control field_name _normal_"
                                                          placeholder="输入 病史">{{ $form?->past_med }}</textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>诊断</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                                <textarea type="text" name="diagnosis" rows="5"
                                                          class="form-control field_name _normal_"
                                                          placeholder="输入 诊断">{{ $form?->diagnosis }}</textarea>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group row form-field">
                                        <div class="col-md-2 text-capitalize control-label"><span>评估总结</span></div>
                                        <div class="col-md-8 ">
                                            <div class="help-block with-errors"></div>
                                            <div class="input-group">
                                                <textarea type="text" name="summary" rows="5"
                                                          class="form-control field_name _normal_"
                                                          placeholder="输入 评估总结">{{ $form?->summary }}</textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>

                        <!-- Footer -->
                        <div class="box-footer">
                            <div class="col-md-12">
                                <div class="btn-group pull-right">
                                    <button class="btn btn-primary submit"><i class="feather icon-save"></i> 提交</button>
                                </div>
                                <div class="btn-group pull-left">

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script>
    Dcat.init('#form-fitness .field_birthday._normal_', function (self) {
        self.datetimepicker({"format": "YYYY-MM-DD", "locale": "zh_CN", "allowInputToggle": true});
    });
</script>


{!! admin_js('vendor/dcat-admin/dcat/plugins/layer/layer.js?v2.2.2-beta') !!}
{!! admin_js('vendor/dcat-admin/dcat/plugins/jquery.initialize/jquery.initialize.min.js?v2.2.2-beta') !!}
{!! admin_js('vendor/dcat-admin/dcat/plugins/moment/moment-with-locales.min.js?v2.2.2-beta') !!}
{!! admin_js('vendor/dcat-admin/dcat/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js?v2.2.2-beta') !!}
{!! admin_js('vendor/dcat-admin/dcat/plugins/select/select2.full.min.js?v2.2.2-beta') !!}


